package com.hivis.service.impl;

import com.hivis.entity.NotebookMsg;
import com.hivis.mapper.NotebookMsgMapper;
import com.hivis.service.INotebookMsgService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Transactional
@Service
public class NotebookMsgServiceImpl implements INotebookMsgService {
    @Resource
    private NotebookMsgMapper notebookMsgMapper;

    @Override
    public List<NotebookMsg> selectByNotebooke(Map<String ,Object> params) {
        return notebookMsgMapper.selectByNotebooke(params);
    }

    @Override
    public int selectCountByNotebooke(Map<String, Object> params) {
        return notebookMsgMapper.selectCountByNotebooke(params);
    }


    @Override
    public int addMessage(NotebookMsg notebookMsg) {
        return notebookMsgMapper.insertSelective(notebookMsg);
    }

    @Override
    public void deleteExpiredMessage(int expireHours) {
        notebookMsgMapper.deleteExpiredMessage(expireHours);
    }
}
